---@class Battle.BuffEffect10012001:Battle.BuffEffectBase
---伤害转移
local BuffEffect10012001 = Battle.CreateClass("BuffEffect10012001",Battle.BuffEffectBase)
Battle.BuffEffect10012001 = BuffEffect10012001
function BuffEffect10012001:OnCreate(buff)
    ---@type Battle.Buffer
    self.buff = buff
    ---@type Battle.Entity
    self.actor = Battle.ActorManager.GetActor(self.buff.targetId);
end

---buff生效时
function BuffEffect10012001:OnBuffStart(...)
    local param = { ... };
    ---@type  Battle.DamageData
    local data = param[1]
    --local list = Battle.ActorManager.GetActorListBySign(self.actor.camp,self.tagId)
    --if #list == 0 then return end
    --local damage =  damageData.damage / #list--分摊
    local source = self.buff.sourceSender
    if(source == nil or source:IsDead() or source == self.actor) then
        return
    end

    local damage = data.damage
    --加血不转移
    if damage <= 0 then
        return
    end
    --伤害转移
    data.damage = 0
    local damageData = Battle.BattleUtil.CreateDamageData2({},data.attacker,data.target,data.hurtType,damage,data.isCrit,data.sourceType,data.sourceId,true)
    source:Hurt(damageData)
    --source:LossHp(damage,damageData.attacker)
end
return BuffEffect10012001